﻿using System.Reflection;

namespace CodeContrib.Hydrator
{
	public class Mapping : IMapping
	{
		private readonly PropertyInfo _propertyInfo;
		private readonly IRandom _random;

		public PropertyInfo PropertyInfo
		{
			get { return _propertyInfo; }
		}

		public Mapping(PropertyInfo propertyInfo, IRandom random)
		{
			Guard.NotNull(propertyInfo, "propertyInfo");
			Guard.NotNull(random, "random");

			_propertyInfo = propertyInfo;
			_random = random;
		}

		public object Next()
		{
			return _random.Next();
		}
	}
}